package com.ruix.app.util;

import android.text.TextUtils;

import com.ruix.app.model.Role;

/**
 * Created by hadexs on 2017/5/3.
 */

public class RoleUtil {


    public static String roleDisplayValue(String roleID){
        if (!TextUtils.isEmpty(roleID)) {
            if ("1".equals(roleID)){
                return "导师";
            } else if ("5".equals(roleID)){
                return "小助手";
            } else if ("6".equals(roleID)){
                return "嘉宾";
            } else if ("8".equals(roleID)){
                return "班主任";
            } else if ("9".equals(roleID)){
                return "班委";
            } else if ("10".equals(roleID)){
                return "班长";
            } else if ("50".equals(roleID)){
                return "学友";
            }

        }
        return null;
    }


    public static boolean isStudent(String roleID){
        return "50".equals(roleID);
    }

    public static boolean isTeacher(String roleID){
        return "1".equals(roleID);
    }

    public static boolean  isAdviser(String roleID){
        return "8".equals(roleID);
    }


    //案例学习被点赞
    public static boolean isLikedUnusable(String roleID){
        return"1".equals(roleID) ||  "8".equals(roleID);
    }


    //班主任或小助手
    public static boolean isAdviserOrHelper(String roleID){
        return  "8".equals(roleID) || "5".equals(roleID);
    }

    //班主任或小助手或者导师
    public static boolean isAdviserOrHelperOrTeacher(String roleID){
        return  "8".equals(roleID) || "5".equals(roleID)|| "1".equals(roleID);
    }

    //班主任或小助手或者嘉宾
    public static boolean isAdviserOrHelperOrGuest(String roleID){
        return  "8".equals(roleID) || "5".equals(roleID) || "6".equals(roleID);
    }

    //是否可以控制 分享
    public static boolean isCanControllShare(String roleID){
        return "8".equals(roleID) || "5".equals(roleID);
    }

    //禁言功能
    public static boolean isCanControllProhibite(String roleID){
        return"8".equals(roleID) || "5".equals(roleID);
    }


    //是否可以发送通知
    public static boolean isCanSendNotice(String roleID,boolean isTeacherFriendCircle){
        if (isTeacherFriendCircle){
            return"1".equals(roleID) || "5".equals(roleID);
        } else {
            return"8".equals(roleID) || "5".equals(roleID);
        }

    }

    //语言探讨
    public static boolean isCanSendVoice(String roleID,boolean isTeacherFriendCircle){
        if (isTeacherFriendCircle){
            return"8".equals(roleID) || "5".equals(roleID) || "6".equals(roleID);
        } else {
            return"1".equals(roleID) || "5".equals(roleID) || "6".equals(roleID);
        }
    }

    public static boolean isCanMute(String roleID){
        return"9".equals(roleID) || "10".equals(roleID) || "50".equals(roleID);
    }



}
